package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingProjectDto;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.*;

/**
 * @Description NursingProjectMapper
 * @Author shuaijie LI
 * @Date 2024-08-24
 */
@Mapper
public interface NursingProjectMapper {
    Page<NursingProjectVo> page(String name, Integer pageNum, Integer pageSize, Integer status);

    @Insert("insert into nursing_project(remark,nursing_requirement,image,unit,name,order_no,price,status,create_time,update_time,create_by,update_by) values(#{remark},#{nursingRequirement},#{image},#{unit},#{name},#{orderNo},#{price},#{status},#{createTime},#{updateTime},#{createBy},#{updateBy})")
    void addNursingProject(NursingProject bean);

    @Select("select * from nursing_project where id = #{id}")
    NursingProject getById(Long id);

    @Update("update nursing_project set name = #{name},unit = #{unit},price = #{price},image = #{image},nursing_requirement = #{nursingRequirement},status = #{status},update_time = #{updateTime} where id = #{id}")
    void updateNursingProject(NursingProject nursingProject);

    @Delete("delete from nursing_project where id = #{id}")
    void delete(Long id);

    @Update("update nursing_project set status = #{status} where id = #{id}")
    void updateStatus(Long id, Integer status);
}
